package com.sena.crawler.domian;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * @author Admin
 */
public class Link {
    /**
     * 连接地址
     */
    private String link;
    /**
     * 总连接
     */
    private String totalUrl;
    /**
     * 类型
     */
    private String type;
    /**
     * 开始
     */
    private Integer start;
    /**
     * 结束
     */
    private Integer end;
    /**
     * detailUrl
     */
    private String detailUrl;
    /**
     * 父连接
     */
    private String pLink;


    private String LinkName;

    private String status;

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getTotalUrl() {
        return totalUrl;
    }

    public void setTotalUrl(String totalUrl) {
        this.totalUrl = totalUrl;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public Integer getEnd() {
        return end;
    }

    public void setEnd(Integer end) {
        this.end = end;
    }

    public String getDetailUrl() {
        return detailUrl;
    }

    public void setDetailUrl(String detailUrl) {
        this.detailUrl = detailUrl;
    }

    public String getpLink() {
        return pLink;
    }

    public void setpLink(String pLink) {
        this.pLink = pLink;
    }

    public String getLinkName() {
        return LinkName;
    }

    public void setLinkName(String linkName) {
        LinkName = linkName;
    }

    @Override
    public String toString() {
        return "Link{" +
                "link='" + link + '\'' +
                ", totalUrl='" + totalUrl + '\'' +
                ", type='" + type + '\'' +
                ", start=" + start +
                ", end=" + end +
                ", detailUrl='" + detailUrl + '\'' +
                ", pLink='" + pLink + '\'' +
                ", LinkName='" + LinkName + '\'' +
                '}';
    }

    public Link() {
    }

    public Link(String link, String totalUrl, String type, Integer start, Integer end, String detailUrl, String pLink, String linkName) {
        this.link = link;
        this.totalUrl = totalUrl;
        this.type = type;
        this.start = start;
        this.end = end;
        this.detailUrl = detailUrl;
        this.pLink = pLink;
        LinkName = linkName;
    }


    public Link(String link, Integer start, Integer end) {
        this.link = link;
        this.start = start;
        this.end = end;
        this.pLink = pLink;

    }

    public Link(String link, String type, String pLink, String linkName) {
        this.link = link;
        this.type = type;
        this.pLink = pLink;
        LinkName = linkName;
    }


    public Link(String link, String totalUrl, String type, String detailUrl, String pLink, String linkName) {
        this.link = link;
        this.totalUrl = totalUrl;
        this.type = type;
        this.detailUrl = detailUrl;
        this.pLink = pLink;
        LinkName = linkName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (!(o instanceof Link)) {
            return false;
        }

        Link link1 = (Link) o;

        return new EqualsBuilder().append(link, link1.link).isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37).append(link).toHashCode();
    }
}
